<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MVCWeb.Models.News>>" %>

<%@ Register Src="~/Views/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="mmuc" %>
<%@ Register Src="~/Views/Shared/LogOnUserControl.ascx" TagName="LogOnUserControl" TagPrefix="louc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>
        Community's News</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <louc:LogOnUserControl ID="LogOnUserControl1" runat="server" />
    <!-- BEGIN: MainMenu -->
    <mmuc:MainMenu ID="MainMenu1" runat="server" />
    <!-- END: MainMenu -->
    <br />
    <h2>
        Community's News
    </h2>
    <hr />
    <% foreach (var item in Model)
       { %>
    <table cellpadding="4" cellspacing="1" border="0" width="100%">
        <tr>
            <td valign="top" style="width: 1%" colspan="2">
                <% if (!string.IsNullOrEmpty(item.ImageUrl))
                   { %>
                <img width="200px" alt="" visible='<%= item.ImageUrl.Length > 0 %>' src='<%= item.ImageUrl %>' />
                <%} %>
            </td>
            <td style="width: 100%" valign="top">
                <a class="title" href='<%= Url.Action("ViewDetail", "News", new { id = item.NewsId }) %>'>
                    <%= HttpUtility.HtmlDecode(item.Title) %></a>
                <div style="padding-top: 2px">
                </div>
                Date:
                <%= item.PublishedDate.ToShortDateString() %>
                <div style="padding-top: 2px">
                </div>
                <%= HttpUtility.HtmlDecode(item.SubTitle) %>
            </td>
        </tr>
    </table>
    <br />
    <hr />
    <br />
    <% } %>
</asp:Content>
